<template>
<!-- 	<view>
		<button @click="connect">连接 WebSocket</button>
		<button @click="send">发送消息</button>
		<button @click="disconnect">断开连接</button>
		<view v-for="(msg, index) in messages" :key="index">{{ msg }}</view>
	</view> -->
</template>

<script setup>
// import { ref } from 'vue';
// import { connectWebSocket, disconnectWebSocket, sendMessage } from '@/utils/websocket';

// const messages = ref([]);
// const wsUrl = 'ws://localhost:8080/v1/dial/getData?id=1065'; // 替换为你的 WebSocket 地址

// const connect = () => {
// 	const socket = connectWebSocket(wsUrl);
// 	socket.onmessage = (event) => {
// 		messages.value.push(event.data);
// 	};
// };

// const send = () => {
// 	sendMessage({ type: 'message', content: 'Hello WebSocket!' });
// };

// const disconnect = () => {
// 	disconnectWebSocket();
// };
</script>
